﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace HeresyManager.Traits
{
    [Serializable]
    public class LiturgicalFamiliarity : Trait
    {
        public override string Name
        {
            get { return "Liturgical Familiarity"; }
        }

        Skill[] skills;

        public override IEnumerator<Comunication.Comunicator> Accire(Character c)
        {
            skills = new Skill[] { new Skills.Literacy(Skill.SkillLevel.Basic), new Skills.SpeakLanguages.SpeakLanguageHighGothic(Skill.SkillLevel.Basic) };
            var e = base.Accire(c);
            while (e.MoveNext())
                yield return e.Current;
            foreach (var s in skills)
            {
                e = c.AddSkill(s, this);
                while (e.MoveNext())
                    yield return e.Current;
            }
        }

        public override void DeAccire(Character c)
        {
            base.DeAccire(c);
            foreach (var s in skills)
            {
                c.RemoveSkill(s, this);
            }
        }
    }
}
